import { PrismaClient } from "@prisma/client";
import { NextApiRequest, NextApiResponse } from "next";

export default async function handler(
  req: NextApiRequest,
  res: NextApiResponse
) {
  const prisma = new PrismaClient();
  await prisma.article.delete({ where: { id: req.query.id } });
  res.status(200).json({ code: 200 });
}
